﻿/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __6D9D4B85_3947_4080_B39D_B215EEEBFCF0__
#define __6D9D4B85_3947_4080_B39D_B215EEEBFCF0__

#include "../tools/head.h"

/////////////////////////////////////////////////////////////////////////////////////////
// 

namespace xos_aio
{
    class aio_impl;
    class aio_key;

    class aio_helper
    {
    public:
        aio_helper( aio_impl * pAioImpl );
        ~aio_helper();

    protected:
        int tcp_proc( aio_key * lpKey, int nFilter, int nFlags, int nData );
        int udp_proc( aio_key * lpKey, int nFilter, int nFlags, int nData );

        int helper_proc( xos_box::i_msg * lpMsg );
        int user_tcp( xos_box::i_msg * lpMsg );
        int user_udp( xos_box::i_msg * lpMsg );

    protected:
        aio_impl * m_pAioImpl;

    public:
        int epoll_proc( aio_key * lpKey, int nFilter, int nFlags, int nData );
        int user_request();

    };
} // xos_aio

#endif // __6D9D4B85_3947_4080_B39D_B215EEEBFCF0__
